<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::miss(function () {
    return '404 Not Found!';
});
Route::group('v1', function () {
    Route::post('login', 'login/index')->name('用户登录');
    //需要登录
    Route::group('/', function () {
        Route::post('login-out', 'login/out')->name('退出登录');
        Route::get('get-config', 'common/getConfig')->name('获取配置信息');
        //系统
        Route::group('system', function () {
            Route::get('my-info', 'system.user/getMyInfo')->name('获取当前信息');
            Route::get('user-info', 'system.user/getInfo')->name('获取管理员信息');
            Route::get('user', 'system.user/index')->name('管理员列表');
            Route::get('menu', 'system.menu/index')->name('系统菜单');
            Route::get('menu-info', 'system.menu/getInfo')->name('菜单详情');
            Route::post('menu-save', 'system.menu/saves')->name('修改菜单');
            Route::get('group', 'system.group/index')->name('权限组');
            Route::get('group-rule', 'system.group/getRule')->name('权限组');
            Route::get('group-info', 'system.group/getInfo')->name('权限组-详情');
            Route::post('group-save', 'system.group/saves')->name('修改权限');
            Route::get('log', 'system.log/index')->name('访问日志');
        });
        //用户
        Route::group('user', function () {
            Route::get('user-list', 'user.user/index')->name('获取用信息');
            Route::get('user-save', 'user.user/saves')->name('编辑用户信息');
        });

    })->middleware(\app\middleware\AdminAuth::class);
});